/*
** item.c for Code item in /home/vriely/Work/Template/List
**
** Made by
** Login   <@epitech.net>
**
** Started on  Mon Mar 05 19:06:45 2012
** Last update Tue Jul 10 14:54:01 2012 pierrick druart
*/

#include	<stdlib.h>

#include	"item.h"

static void	init_item_default(struct s_item *this)
{
  if (this != NULL)
  {
    this->next = NULL;
    this->prev = NULL;
  }
}

static void	init_item_param(struct s_item *this, void *content)
{
  if (this != NULL)
  {
    init_item_default(this);
    this->content = content;
  }
}

struct s_item	*new_item_param(void *content)
{
  t_item	*item;

  item = (struct s_item *) malloc(sizeof(struct s_item));
  if (item != NULL)
    init_item_param(item, content);
  return (item);
}

void			delete_item(struct s_item *this)
{
  if (this != NULL)
    free(this);
}
